package lime.dql.view;

import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

public class DqlEditorView extends ViewPart {
	
	public static final String ID = "lime.dql.view.editor";
	
	// Widgets
	private Text dqlText;

	@Override
	public void createPartControl(Composite parent) {
		dqlText = new Text(parent, SWT.WRAP | SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
		dqlText.setFont(JFaceResources.getTextFont());
		dqlText.setText("select * from dm_process order by object_name");
	}

	@Override
	public void setFocus() {
		dqlText.setFocus();
	}
	
	public String getDql() {
		return dqlText.getText();
	}

	public void setDql(String dql) {
		dqlText.setText(dql);
	}
}
